package DOM;

import java.io.File;
import java.util.ArrayList;

public class KSNFilter {

	public static void FilesFilter(String url){
		ArrayList<String> fileA = new ArrayList<String>();
		Utils.flateFile(url, fileA);
		for (String path : fileA) {
			if(path.matches(".*_format=pdf")){
				new File(path).delete();
			}else if(path.matches(".*_tmpl=component.*")){
				String tmp = path.split("_tmpl=component")[0];
				if(fileA.contains(tmp)){
					new File(path).delete();
				}
			}
		}
		System.out.println("Files flated");
	}
	
}
